<!DOCTYPE html>
<html lang="en">
<head> 
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var data1 = new Date('2018/9/3 09:00:00');
    var data2 = new Date('2018/1/1 09:00:00');
    var day = (data1 - data2)/(24*60*60*1000) + 1;
    console.log(day);
  </script>
</body>
</html>